using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Silvery;

namespace Sample01_Base
{
    //这是一个动画例子，用来展示最基本的两点移动效果
    public class Sample_2: NScreen
    {
        NImageM testobj = new NImageM();
        public Sample_2()
        {
            //读取图片，NImage实际上是一个Canvas带了一个Image，这里将Image操作更便捷了
            testobj.LoadImage(new Uri("Res/nowpaper.jpg", UriKind.Relative));
            testobj.OffsetPoint = new Point(-60, -120);
            testobj.Position = new Point(100, 100);
            //添加到屏中
            this.AddBaseObj(testobj);
            App.Current.RootVisual.MouseLeftButtonDown += new MouseButtonEventHandler(RootVisual_MouseLeftButtonDown);
        }

        void RootVisual_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var point = e.GetPosition(null);
            testobj.MoveTo(testobj.Position, point);
        }
        
    }
}
